<?php
class TestAnswerMark extends CActiveRecord {
	
	public static function model($className = __CLASS__) {
		return parent::model($className);
	}

	public function tableName() {
		return strtolower('PsyTestAnswersMark');
	}
	
	public function relations() {
        return array(
            'dim' => array(self::BELONGS_TO, 'TestDimens', 'dimensId',
                'joinType' => 'RIGHT JOIN',
            ),
            'answer' => array(self::BELONGS_TO, 'TestAnswers', 'answerId',
                'joinType' => 'RIGHT JOIN'
            )
        );
	}
	public function rules() {
		return array(
            array('dimensId, mark, answerId', 'required'),
            array('mark', 'numerical')
		);
	}
    public function attributeLabels() {
        return array(
            'dimensId' => '维度',
            'mark' => '分数'
        );
    }
}
